{	Problem: http://codeforces.ru/problemset/problem/44/C
	Verdict: Accepted
}
var 
    i,j,n,m,l,r:longint;
    a:array[0..110] of longint;

begin
read(n,m);
fillchar(a,sizeof(a),0);
for i:=1 to m do begin
    read(l,r);
    for j:=l to r do 
        inc(a[j]);
end;
for i:=1 to n do
    if a[i]<>1 then begin
        write(i,' ',a[i]);
        halt;
    end;
write('OK');
end.